input_hud: Divide hints between left and right margins#2096
Merged
Conversation
|
Play this branch at https://play.threadbare.game/branches/endlessm/wjt/input-hud-divide-hints-between-left-and-right-margins/. (This launches the game from the start, not directly at the change(s) in this pull request.) |
manuq
approved these changes
Apr 2, 2026
Collaborator
manuq
left a comment
There was a problem hiding this comment.
Tested in the web build. Nice improvement! I note that:
- The hints are over the version number when the Pause overlay is visible. Maybe the PauseOverlay autoload should be moved above the InputHud autoload.
- The hints at the right side of the screen need a margin, so words "Throw" or "Repel" don't appear at the border of the viewport.
| @onready var throw_input_hint: HBoxContainer = $TabContainer/NormalControls/ThrowInputHint | ||
| @onready var sokoban_controls: HBoxContainer = $TabContainer/SokobanControls | ||
| @onready var skip_input_hint: HBoxContainer = $TabContainer/SokobanControls/SkiptInputHint | ||
| @onready var skip_input_hint: HBoxContainer = $TabContainer/SokobanControls/SkipInputHint |
| [node name="RepelInputHint" parent="TabContainer/NormalControls" unique_id=1938432601 instance=ExtResource("3_xu7en")] | ||
| visible = false | ||
| [node name="Spacer" type="Control" parent="TabContainer/NormalControls" unique_id=1059909765] | ||
| editor_description = "This empty control expands to fill the center of the hbox, pushing any controls packed after it to the right margin." |
Member
Author
|
Good point. The hints also appear above the scene transition fade - I was planning to address that separately, but hadn't spotted the pause menu has the same issue. I also want to hide them during dialogue! |
Member
Author
|
I'll add a margin in this PR and open a follow-up for hide during pause etc. |
515e593 to
abbe09b
Compare
Using a spacer control that expands to fill any spare space in its HBox, push some controls to the right margin. Pack everything inside a MarginContainer to add a small amount of padding to the right-hand side. This is because the text directly abuts the right edge of the container, whereas on the left-hand side the icons have a bit of padding built in. I picked the number 8 by inspecting the keyboard arrows and joypad dpad icons, which they have 8px of margin on the left. For normal gameplay, keep movement, running, and interact on the left-hand side. Move repel & grapple to the right. This means that the interact hint, which appears and disappears as you move around the level, does not cause the position of the other actions to change. For Sokoban, put the movement hints on the left, and the actions on the right. Move Skip before the other two so that when it appears it does not affect the position of the other hints. Fix a typo in the name of the Skip node. Access nodes by unique name, following the style documented in our Contributing page. https://github.com/endlessm/threadbare/wiki/Contributing#use-unique-names-to-reference-nodes-in-scripts
abbe09b to
a1977fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using a spacer control that expands to fill any spare space in its HBox,
push some controls to the right margin. Pack everything inside a
MarginContainer to add a small amount of padding to the right-hand side.
This is because the text directly abuts the right edge of the container,
whereas on the left-hand side the icons have a bit of padding built in.
I picked the number 8 by inspecting the keyboard arrows and joypad dpad
icons, which they have 8px of margin on the left.
For normal gameplay, keep movement, running, and interact on the
left-hand side. Move repel & grapple to the right. This means that the
interact hint, which appears and disappears as you move around the
level, does not cause the position of the other actions to change.
For Sokoban, put the movement hints on the left, and the actions on the
right. Move Skip before the other two so that when it appears it does
not affect the position of the other hints. Fix a typo in the name of
the Skip node.
Access nodes by unique name, following the style documented in our
Contributing page.
https://github.com/endlessm/threadbare/wiki/Contributing#use-unique-names-to-reference-nodes-in-scripts